<div class="myRightType">
	<div class="title" >
		<a href="javascript:;" ng-class="{active:list==1}" ng-click="list=1">审核列表</a>
		<a href="javascript:;" ng-class="{active:list==2}" ng-click="list=2">历史审核列表</a>
	</div>
	<div class="inner clearfix"  ng-init="list=1">
		<div class="box clearfix" ng-show="list==1">
			<div class="row" >
				<div class="col-md-2">
					<p>审核列表</p>
				</div>
				<div class="col-md-10 tr">
					<!--<a href="javascript:;" class="rfoat" id="addAdmin"> <i class="glyphicon glyphicon-plus"></i></a>-->

					<div class="search rfoat">
						<input type="text" placeholder="输入账号" id="Shen_mt5" />
						<i class="glyphicon glyphicon-search" id="Shen_search"></i>

					</div>

				</div>
			</div>
		<br />
		<table id="exList" class="clearfix"></table>
           
         
		</div>
		<div class="box clearfix" ng-show="list==2">
			<div class="row" >
				<div class="col-md-2">
					<p>历史审核列表</p>
				</div>
				<div class="col-md-10 tr">
					<!--<a href="javascript:;" class="rfoat" id="addAdmin"> <i class="glyphicon glyphicon-plus"></i></a>-->

					<div class="search rfoat">
						<input type="text" placeholder="输入账号" id="Histtory_mt5" />
						<i class="glyphicon glyphicon-search" id="Histtory_search"></i>

					</div>

				</div>
			</div>
		<br />
		<table id="exList2" class="clearfix"></table>
           
         
		</div>

		

	</div>

</div>

<script type="text/javascript">

//审核列表
	$('#exList').bootstrapTable({
		url: "/wechat_mt5/mt/user/reviews",
		method: 'get',
		columns: [{
			field: 'mtLogin',
			title: '交易账号'
		}, {
			field: 'type',
			title: '账号类型',
			formatter: type,

		}, {
			field: 'mail',
			title: '邮箱',
			

		}
		, {
			field: 'mobile',
			title: '联系方式',
			

		}
		, {
			field: 'createTime',
			title: '提交日期',
			formatter:date
			

		},
		 {
			field: 'id',
			title: '操作',
			formatter: operation,
			

		}],
		height: 650,
		pageSize: 10,
		pageList: [10, 25, 50, 100],
		showRefresh: true,
		editable: true,
		// onClickRow:operateEvents,
		// showColumns: true,
		pagination: true,
//		striped: true,
		sidePagination: 'server',

	});
	//历史记录列表
	console.log($('#exList2'))
	$('#exList2').bootstrapTable({
		url: "/wechat_mt5/mt/user/to/reviews",
		method: 'get',
		columns: [{
			field: 'mtLogin',
			title: '交易账号'
		}, {
			field: 'type',
			title: '账号类型',
			formatter: type,

		}, {
			field: 'mail',
			title: '邮箱',
			

		}
		, {
			field: 'mobile',
			title: '联系方式',
			

		}
		, {
			field: 'createTime',
			title: '提交日期',
			formatter:date
			

		},
		 {
			field: 'state',
			title: '操作',
			formatter: result,
			

		}],
		height: 700,
		pageSize: 10,
		pageList: [10, 25, 50, 100],
		showRefresh: true,
		editable: true,
		// onClickRow:operateEvents,
		// showColumns: true,
		pagination: true,
//		striped: true,
		sidePagination: 'server',

	});
	function type(value, row, index){
		if(value=="0"){
			return "大牛"
		}else{
			return "跟随者"
		}
	}
	
	function operation(value, row, index){
		var info=JSON.stringify(row)
		return [
				"<button type='button' class='btn btn-success' onclick='yes(" +info+ ")'>通过</button><button type='button' class='btn btn-danger' onclick='no(" + info+ ")'>拒绝</button>",

			].join("")
    
	}
	
	//同意
	function yes(info){
		$.ajax({
				type: "put",
				url: "/wechat_mt5/admin/update/mt/state/agree",

				data: {
					 id: info.id,
					userId:info.userId,
					updateTime:info.updateTime

				},
				success: function(data) {
                       if(data.code==0){
                          prompt("审核成功！");
                          $('#exList').bootstrapTable(
							"refresh", {
								url: "/wechat_mt5/mt/user/reviews"
							}
						);
                          
                       
                       }else{
                          prompt("审核失败！")
                       
                       }
				}

			})
	}
	//驳回
	function no(info){
		$.ajax({
				type: "put",
				url: "/wechat_mt5/admin/update/mt/state/disagree",

				data: {
					 id: info.id,
					 updateTime:info.updateTime
				

				},
				success: function(data) {
                      if(data.code==0){
                          prompt("驳回成功！");
                          $('#exList').bootstrapTable(
							"refresh", {
								url: "/wechat_mt5/mt/user/reviews"
							}
						);
                                          
                       }else{
                          prompt("审核失败！")
                       
                       }
				}

			})
	}
	//结果
	function result(state){
		if(state=="0"){
			return "<p class='blue'>已通过</p>"
		}else{
			return "<p class='red'>已拒绝</p>"
		}
	}
	
	//搜索处
	
		lookSearch($("#Shen_search"),$("#Shen_mt5"),$('#exList'));
		lookSearch($("#Histtory_search"),$("#Histtory_mt5"),$('#exList2'));
		
	
	
	

	
</script>